package com.qfedu.edu.result;

/**
 * @author xiaobobo
 * @title: ResponseCode
 * @projectName cd-fy-2401-third-project-parent
 * @description: 这个就是消息枚举
 * @date 2024/9/13  14:47
 */
public enum ResponseCode {

    SUCCESS(0, "请求成功"),
    LOGIN_EXCEPTION(100, "登陆失败"),
    AUTHENTICATION_EXCEPTION(401, "身份校验失败"),
    NO_PERMISSION_EXCEPTION(403, "没有权限访问这个方法"),
    SQL_EXCEPTION(101, "SQL异常"),
    SYSTEM_EXCEPTION(102, "系统异常"),
    PARAM_EXCEPTION(103, "参数有误"),
    DIRECTION_EXCEPTION(104, "请求没有来自于网关"),
    CLASS_ID_NOT_FOUND_EXCEPTION(105, "课程id为空"),
    CLICK_REPEAT_EXCEPTION(106, "秒杀太过频繁稍后重试"),
    BUY_REPEAT_EXCEPTION(107, "用户已经秒杀过该产品了不能重复秒杀"),
    PRO_COUNT_OVER_EXCEPTION(108, "产品已经秒杀了，请下次购买.."),
    ORDER_NUMBER_EXCEPTION(109, "订单号有误...."),
    LOCK_EXCEPTION(110, "加锁遇到问题...."),
    FAIL(-1, "请求失败");

    private Integer code;

    private String msg;

    ResponseCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
